package cn.iocoder.yudao.module.mqtt.enums.mqtt;


public enum AlarmTypeEnum {
    BL("1"), // 变量
    LX("2"),  //离线
    DD("3");  // 断电

    private final String code;

    AlarmTypeEnum(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public static AlarmTypeEnum fromCode(String code) {
        for (AlarmTypeEnum type : AlarmTypeEnum.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        throw new IllegalArgumentException("Unknown alarm type code: " + code);
    }
}


